<?php


/** ensure this file is being included by a parent file */
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );

/**
 * @package	
 */
class HelpDeskXML {
	
    var $xml;
    
    function __construct() {
        
    }
    
    function xmlBuilder() {
        $this->__construct();
    }
    
    function node($nodeName, $attrs=array(), $cdata='', $hasCloseTag=1) {
        $attrs_str = null;
        if (count($attrs))
        {
            $attrs_str = " ";
            foreach($attrs as $k=>$v)
            {
                if (!empty($k))
                {
                    $attrs_str .= " $k=\"$v\"";
                }
            }
        } 
        
        $this->xml = "<$nodeName$attrs_str";
        if ($hasCloseTag)
        {
            $this->xml .= ">" . trim($cdata) . "</$nodeName>\n";
        } 
        else 
        {
            $this->xml .= "/>";
        }
        return $this->xml;
    }	

}